#include <iostream>
using namespace std;

typedef long long LL;

const int N = 55,M = 15;
LL a[N];
int k,d;

LL INF = 0x3f3f3f3f3f3f3f;
LL f[N][M],g[N][M];



int main() {
    int n;
    cin >> n;
    for(int i = 1;i <= n;i++)
    {
        cin >> a[i];
    }
    cin >> k >> d;
    for(int i = 1;i <= n;i++)
    {
        g[i][1] = f[i][1] = a[i];
        for(int j = 2;j <= min(i,k);j++)
        {
            f[i][j] = -INF;
            g[i][j] = INF;
            for(int prev = max(i - d,j - 1);prev <= i - 1;prev++)
            {
                f[i][j] = max(max(f[prev][j - 1] * a[i],g[prev][j - 1] * a[i]),f[i][j]);
                g[i][j] = min(min(f[prev][j - 1] * a[i],g[prev][j - 1] * a[i]),g[i][j]);
            }
        }
    }
    LL ret = -INF;
    for(int i = k;i <= n;i++)
    {
        ret = max(ret,f[i][k]);
    }
    cout << ret << endl;
    return 0;
}
// 64 位输出请用 printf("%lld")